<%@page pageEncoding="UTF-8" contentType="text/html;  charset = UTF-8" isELIgnored="false" %>
<%--导入标签库--%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
	<head>
		<title>emplist</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="css/style.css" />
	<script type="text/javascript" src="js/jQuery-v3.4.1.js"></script>
		<script type="text/javascript">
			$(function () {
$("#btn").click(function () {
	window.location = 'add_user.jsp'
})
			})
		</script>
	</head>
	<body>

		<div id="wrap" style="width: 90%">
			<div id="top_content">
			<!--header-->
				<%@include file="tou.jsp"%>

				<div id="content">
					<p id="whereami">
					</p>
					<h1>
						Welcome!
					</h1>
					<table class="table">
						<tr class="table_header">
							<td>
								ID
							</td>
							<td>
								用户名
							</td>
							<td>
								密码
							</td>
							<td>
								电话
							</td>
							<td>
								地址
							</td>
							<td>
								创建时间
							</td>
<%--							<td>--%>
<%--								更新时间--%>
<%--							</td>--%>
							<td>
								状态
							</td>
							<td>
								操作
							</td>
						</tr>
						<!-- items遍历的容器   var，从容器中遍历出来的每一个名字  -->
						<c:forEach items="${users}" var="user">
						<tr class="row1">
							<td>
								${user.id}
							</td>
							<td>
								${user.name}
							</td>
							<td>
									${user.password}
							</td>
							<td>
									${user.phone}
							</td>
							<td>
									${user.address}
							</td>
							<td>
									${user.creatTime}
							</td>

							<td>
									${user.status}
							</td>
<%--							<td>--%>
<%--									${user.updatetime}--%>
<%--							</td>--%>
							<td>
								<a id ="del" href="javascript:;" onclick="del(${user.id})">删除</a>&nbsp;<a href="load.user?id=${user.id}">更新</a>
							</td>

						</tr>
						</c:forEach>
						<script>
							function del(id){
								if(confirm("你确定要删除"+id+"吗？")){
									window.location.href="delete.user?id=" +id;

								}

							}

						</script>
					</table>
					<p>
						<input  id="btn" type="button" class="button" value="用户注册"/>
					</p>
				</div>
			</div>
			<%@include file="jio.jsp"%>
		</div>
	</body>
</html>
